<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
                "http://www.w3.org/TR/REC-html40/loose.dtd">
<html>
<head>
  <title>Description of convnFast</title>
  <meta name="keywords" content="convnFast">
  <meta name="description" content="Fast convolution, replacement for both conv2 and convn.">
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
  <meta name="generator" content="m2html &copy; 2003 Guillaume Flandin">
  <meta name="robots" content="index, follow">
  <link type="text/css" rel="stylesheet" href="../m2html.css">
</head>
<body>
<a name="_top"></a>
<!-- menu.html images -->
<h1>convnFast
</h1>

<h2><a name="_name"></a>PURPOSE <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2>
<div class="box"><strong>Fast convolution, replacement for both conv2 and convn.</strong></div>

<h2><a name="_synopsis"></a>SYNOPSIS <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2>
<div class="box"><strong>function C = convnFast( A, B, shape ) </strong></div>

<h2><a name="_description"></a>DESCRIPTION <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2>
<div class="fragment"><pre class="comment"> Fast convolution, replacement for both conv2 and convn.

 See conv2 or convn for more information on convolution in general.

 This works as a replacement for both conv2 and convn.  Basically,
 performs convolution in either the frequency or spatial domain, depending
 on which it thinks will be faster (see below). In general, if A is much
 bigger then B then spatial convolution will be faster, but if B is of
 similar size to A and both are fairly big (such as in the case of
 correlation), convolution as multiplication in the frequency domain will
 tend to be faster.

 The shape flag can take on 1 additional value which is 'smooth'.  This
 flag is intended for use with smoothing kernels.  The returned matrix C
 is the same size as A with boundary effects handled in a special manner.
 That is instead of A being zero padded before being convolved with B;
 near the boundaries a cropped version of the matrix B is used, and the
 results is scaled by the fraction of the weight found in  the cropped
 version of B.  In this case each dimension of B must be odd, and all
 elements of B must be positive.  There are other restrictions on when
 this flag can be used, and in general it is only useful for smoothing
 kernels.  For 2D filtering it does not have much overhead, for 3D it has
 more and for higher dimensions much much more.

 For optimal performance some timing constants must be set to choose
 between doing convolution in the spatial and frequency domains, for more
 info see timeConv below.

 USAGE
  C = convnFast( A, B, [shape] )

 INPUTS
  A       - d dimensional input matrix
  B       - d dimensional matrix to convolve with A
  shape   - ['full'] 'valid', 'full', 'same', or 'smooth'

 OUTPUTS
  C       - result of convolution

 EXAMPLE

 See also CONV2, CONVN

 Piotr's Computer Vision Matlab Toolbox      Version 2.61
 Copyright 2014 Piotr Dollar.  [pdollar-at-gmail.com]
 Licensed under the Simplified BSD License [see external/bsd.txt]</pre></div>





<!-- Start of Google Analytics Code -->
<script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script>
<script type="text/javascript">
var pageTracker = _gat._getTracker("UA-4884268-1");
pageTracker._initData();
pageTracker._trackPageview();
</script>
<!-- end of Google Analytics Code -->

<hr><address>Generated by <strong><a href="http://www.artefact.tk/software/matlab/m2html/" target="_parent">m2html</a></strong> &copy; 2003</address>
</body>
</html>
